package remato.client.view.util.viewfilters;

import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.viewers.ViewerFilter;

import remato.client.model.CategoryWrapper;
import remato.client.model.ProjectWrapper;
import remato.client.model.RequirementWrapper;
import remato.client.model.RootProjectSystemWrapper;

public class RequirementViewFilter extends ViewerFilter {
	@Override
	public boolean select(Viewer viewer, @SuppressWarnings("unused") Object parentElement, Object element) {
		if ((element instanceof RequirementWrapper 
				&& ( null != element 
				&& ! element.equals(viewer.getInput()) ))
				|| element instanceof RootProjectSystemWrapper 
				|| element instanceof ProjectWrapper 
				|| element instanceof CategoryWrapper ) {
			return true;
		}
		return false;
	}
}